package cn.itgod.utils;

import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm;

import java.util.Date;
import java.util.Map;
/*令牌工具类*/
public class JwtUtils {
    private static String signKey = "SVRIRUlNQQ==";
    private static Long expire = 43200000L;
    /*产生令牌*/
    public static String spawJwt(Map<String,Object> claims){
        String jwt = Jwts.builder()
                .addClaims(claims)
                .signWith( SignatureAlgorithm.HS256, signKey)
                .setExpiration(new Date(System.currentTimeMillis()+expire))
                .compact();
        return jwt;
    }

}
